import requests

from common.root_login import login_token
from config import BASE_URL, emp


# 公共获取员工id方法
def empid(body):
    url = BASE_URL + emp.addemp
    headers = login_token()
    res = requests.post(url, headers=headers, json=body)
    id =res.json()["data"].get('id')
    return id


if __name__ == '__main__':
    body = {
        "username":"aaaa",
        "mobile":"18210222009",
        "workNumber":"1001"
    }
    res = empid(body)
    print(res)
